from itertools import accumulate
from typing import List
inf = float('inf')

class Solution:
    def splitArray(self, nums: List[int]) -> int:
        prefix = [0] + list(accumulate(nums))
        n = len(nums)
        k = n-1
        # 预处理右侧最长
        while k >= 0 and nums[k] < nums[k-1]:
            k -= 1
        ans = inf
        for i in range(n):
            if i and nums[i] < nums[i-1]: break
            if i < k: continue
            prev = prefix[i+1]
            nexts = prefix[-1] - prefix[i]

if __name__ == '__main__':
    s = Solution()
    r = s.splitArray()